window.vm = new Vue({
    el: '#app',
    data: {
        all: [],
        user: '',
        activeName: 'first',
        accepted: null,


        processAll: '',
        processApp: '',
        processUnApp: '',


        displayOptions:[
            {
                value:"1",
                label:"是"
            },
            {
                value:"0",
                label:"否"
            }
        ],

        members: {
            data: [],
            rules: {
                name: [
                    {required: true, message: "请输入姓名", trigger: ['blur', 'change']},
                    {max: 20, message: "长度在20个字符以内", trigger: ['blur', 'change']},
                ],
                no: [
                    {required: true, message: "请输入工号", trigger: ['blur', 'change']},
                    {max: 20, message: "长度在20个字符以内", trigger: ['blur', 'change']},
                ],
            },
        },
    },
    methods: {
        handleClick(tab, event) {
            // console.log(tab, event);
        },

        toIndex:function(){
            top.location.href="index.html"
        },

        display(value){
            vm.all.respaName = value
        },



        toOneDesk:function (value){
            sessionStorage.setItem("processNo",JSON.stringify(value));
            sessionStorage.setItem("html","approve")
            top.location.href = "oneDesk.html"
        },



    },


    created: function () {

        //获取所有工单信息
        axios.get(
            "/getAllProApp",
        ).then(function (res) {
            vm.processAll=res.data
        }).catch(e => {
            ajaxError(vm, e);
        });

        //获取未审批工单信息
        axios.get(
            "/getAllUnApp",
        ).then(function (res) {
            vm.processUnApp=res.data
        }).catch(e => {
            ajaxError(vm, e);
        });


        //已经审批的单
        axios.get(
            "/getAllApp",
        ).then(function (res) {
            vm.processApp=res.data
        }).catch(e => {
            ajaxError(vm, e);
        });



    },
});